<template>
	<view>
		<view class="go-top" @click="goTop()">
			回到顶部
		</view>
	</view>
</template>

<script>
	export default {
		name: "go-top",
		data() {
			return {

			};
		},
		methods: {
			goTop() {
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 300,

				});

			}
		}
	}
</script>

<style scoped lang="scss">
	.go-top {
		width: 110rpx;
		height: 110rpx;
		border: 1px solid #ccc;
		border-radius: 50%;
		font-size: 38rpx;
		text-align: center;
		position: fixed;
		right: 20rpx;
		bottom: 120rpx;
		opacity: 0.6;

		&:active {
			opacity: 1;
		}
	}
</style>